.class public Lcn/domob/android/ads/g;
.super Ljava/lang/Object;
.source "SourceFile"


# static fields
.field private static a:Lcn/domob/android/ads/H;

.field private static b:Lcn/domob/android/ads/g;


# instance fields
.field private c:Ljava/lang/String;

.field private d:Ljava/lang/String;

.field private e:Ljava/lang/String;

.field private f:Z

.field private g:J

.field private h:I

.field private i:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 2

    new-instance v0, Lcn/domob/android/ads/H;

    const-class v1, Lcn/domob/android/ads/g;

    invoke-virtual {v1}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Lcn/domob/android/ads/H;-><init>(Ljava/lang/String;)V

    sput-object v0, Lcn/domob/android/ads/g;->a:Lcn/domob/android/ads/H;

    return-void
.end method

.method public constructor <init>()V
    .locals 2

    const/4 v1, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-string v0, "http://r.domob.cn/a/"

    iput-object v0, p0, Lcn/domob/android/ads/g;->c:Ljava/lang/String;

    iput-object v1, p0, Lcn/domob/android/ads/g;->d:Ljava/lang/String;

    iput-object v1, p0, Lcn/domob/android/ads/g;->e:Ljava/lang/String;

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcn/domob/android/ads/g;->f:Z

    iput-object v1, p0, Lcn/domob/android/ads/g;->i:Ljava/lang/String;

    return-void
.end method

.method public static declared-synchronized a()Lcn/domob/android/ads/g;
    .locals 2

    const-class v0, Lcn/domob/android/ads/g;

    monitor-enter v0

    :try_start_0
    sget-object v1, Lcn/domob/android/ads/g;->b:Lcn/domob/android/ads/g;

    if-nez v1, :cond_0

    new-instance v1, Lcn/domob/android/ads/g;

    invoke-direct {v1}, Lcn/domob/android/ads/g;-><init>()V

    sput-object v1, Lcn/domob/android/ads/g;->b:Lcn/domob/android/ads/g;

    :cond_0
    sget-object v1, Lcn/domob/android/ads/g;->b:Lcn/domob/android/ads/g;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit v0

    return-object v1

    :catchall_0
    move-exception v1

    monitor-exit v0

    throw v1
.end method


# virtual methods
.method protected a(Landroid/content/Context;)Ljava/lang/String;
    .locals 4

    const/4 v3, 0x0

    iget-object v0, p0, Lcn/domob/android/ads/g;->d:Ljava/lang/String;

    if-nez v0, :cond_0

    :try_start_0
    invoke-virtual {p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v1

    const/16 v2, 0x80

    invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->getApplicationInfo(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;

    move-result-object v0

    if-eqz v0, :cond_0

    iget-object v1, v0, Landroid/content/pm/ApplicationInfo;->metaData:Landroid/os/Bundle;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    if-eqz v1, :cond_0

    :try_start_1
    iget-object v0, v0, Landroid/content/pm/ApplicationInfo;->metaData:Landroid/os/Bundle;

    const-string v1, "DOMOB_PID"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iget-object v1, p0, Lcn/domob/android/ads/g;->d:Ljava/lang/String;

    if-nez v1, :cond_0

    if-eqz v0, :cond_0

    iput-object v0, p0, Lcn/domob/android/ads/g;->d:Ljava/lang/String;

    iget-object v0, p0, Lcn/domob/android/ads/g;->d:Ljava/lang/String;

    invoke-virtual {p0, v0}, Lcn/domob/android/ads/g;->b(Ljava/lang/String;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    :cond_0
    iget-object v0, p0, Lcn/domob/android/ads/g;->d:Ljava/lang/String;

    :goto_0
    return-object v0

    :catch_0
    move-exception v0

    :try_start_2
    const-string v0, "DomobSDK"

    const-string v1, "DOMOB_PID is missed in AndroidManifest.xml!"

    invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    move-object v0, v3

    goto :goto_0

    :catch_1
    move-exception v0

    const-string v1, "DomobSDK"

    const-string v2, "Failed to get applicationInfo."

    invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    sget-object v1, Lcn/domob/android/ads/g;->a:Lcn/domob/android/ads/H;

    invoke-virtual {v1, v0}, Lcn/domob/android/ads/H;->a(Ljava/lang/Throwable;)V

    move-object v0, v3

    goto :goto_0
.end method

.method protected a(Ljava/lang/String;)V
    .locals 3

    if-eqz p1, :cond_0

    sget-object v0, Lcn/domob/android/ads/g;->a:Lcn/domob/android/ads/H;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Set AD server url:"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcn/domob/android/ads/H;->b(Ljava/lang/String;)V

    iput-object p1, p0, Lcn/domob/android/ads/g;->c:Ljava/lang/String;

    :cond_0
    return-void
.end method

.method protected a(ZJI)V
    .locals 0

    iput-boolean p1, p0, Lcn/domob/android/ads/g;->f:Z

    iput-wide p2, p0, Lcn/domob/android/ads/g;->g:J

    iput p4, p0, Lcn/domob/android/ads/g;->h:I

    return-void
.end method

.method protected b()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcn/domob/android/ads/g;->c:Ljava/lang/String;

    return-object v0
.end method

.method protected b(Landroid/content/Context;)Ljava/lang/String;
    .locals 3

    iget-object v0, p0, Lcn/domob/android/ads/g;->e:Ljava/lang/String;

    if-nez v0, :cond_0

    new-instance v0, Lcn/domob/android/ads/a;

    const-string v1, "domob_config"

    invoke-direct {v0, p1, v1}, Lcn/domob/android/ads/a;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    const-string v1, "cookie_id"

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Lcn/domob/android/ads/a;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcn/domob/android/ads/g;->e:Ljava/lang/String;

    :cond_0
    iget-object v0, p0, Lcn/domob/android/ads/g;->e:Ljava/lang/String;

    return-object v0
.end method

.method protected b(Ljava/lang/String;)V
    .locals 3

    if-eqz p1, :cond_0

    if-eqz p1, :cond_1

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v0

    if-nez v0, :cond_1

    :cond_0
    const-string v0, "DomobSDK"

    const-string v1, "Incorrect Domob publisher ID."

    invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    :goto_0
    return-void

    :cond_1
    const-string v0, "DomobSDK"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Current publisherID is "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    iput-object p1, p0, Lcn/domob/android/ads/g;->d:Ljava/lang/String;

    goto :goto_0
.end method

.method protected c()J
    .locals 4

    iget-wide v0, p0, Lcn/domob/android/ads/g;->g:J

    iget v2, p0, Lcn/domob/android/ads/g;->h:I

    mul-int/lit16 v2, v2, 0x3e8

    int-to-long v2, v2

    add-long/2addr v0, v2

    return-wide v0
.end method

.method protected c(Ljava/lang/String;)V
    .locals 0

    iput-object p1, p0, Lcn/domob/android/ads/g;->e:Ljava/lang/String;

    return-void
.end method

.method protected c(Landroid/content/Context;)Z
    .locals 9

    const-wide/16 v7, 0x0

    const/4 v6, 0x0

    iget-boolean v0, p0, Lcn/domob/android/ads/g;->f:Z

    if-eqz v0, :cond_2

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    iget-wide v2, p0, Lcn/domob/android/ads/g;->g:J

    iget v4, p0, Lcn/domob/android/ads/g;->h:I

    mul-int/lit16 v4, v4, 0x3e8

    int-to-long v4, v4

    add-long/2addr v2, v4

    cmp-long v0, v0, v2

    if-gez v0, :cond_1

    const/4 v0, 0x1

    :goto_0
    if-nez v0, :cond_0

    iget-boolean v1, p0, Lcn/domob/android/ads/g;->f:Z

    if-eqz v1, :cond_0

    iput-boolean v6, p0, Lcn/domob/android/ads/g;->f:Z

    iput-wide v7, p0, Lcn/domob/android/ads/g;->g:J

    iput v6, p0, Lcn/domob/android/ads/g;->h:I

    new-instance v1, Ljava/util/HashMap;

    invoke-direct {v1}, Ljava/util/HashMap;-><init>()V

    const-string v2, "timestamp"

    invoke-static {v7, v8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string v2, "disable"

    invoke-static {v6}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string v2, "time"

    invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    new-instance v2, Lcn/domob/android/ads/a;

    const-string v3, "domob_config"

    invoke-direct {v2, p1, v3}, Lcn/domob/android/ads/a;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    invoke-virtual {v2, v1}, Lcn/domob/android/ads/a;->a(Ljava/util/HashMap;)V

    :cond_0
    return v0

    :cond_1
    move v0, v6

    goto :goto_0

    :cond_2
    move v0, v6

    goto :goto_0
.end method

.method protected d()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcn/domob/android/ads/g;->i:Ljava/lang/String;

    return-object v0
.end method

.method protected d(Ljava/lang/String;)V
    .locals 0

    iput-object p1, p0, Lcn/domob/android/ads/g;->i:Ljava/lang/String;

    return-void
.end method
